<?php

namespace App\Http\Controllers\Common;

use App\Http\Controllers\Controller;
use Illuminate\Http\Request;


/**
 * 通用控制器
 */
class ComController extends Controller
{
    /**
     * 上传图片
     */
    public function uploadImg(Request $request, $id)
    {
        if ($path = uploadImg($request,$id)) {
            $this->data = $this->makeJsCode(0,'上传成功！');
            $this->data['path'] = $path;
            return $this->apiJson();
        }
        $this->data= $this->makeJsCode(1, '上传失败！');
        return $this->apiJson();
    }
}